﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CreateUniqueKey.cs" company="SmartPlan">
//   SmartPlan 2011
// </copyright>
// <summary>
//   The create unique key.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DbDiff.Common.Scripting
{
    using DbDiff.Common.DataAccess;

    /// <summary>
    /// The create unique key.
    /// </summary>
    internal class CreateUniqueKey : CreatePrimaryKey
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateUniqueKey"/> class.
        /// </summary>
        /// <param name="schema">
        /// The schema.
        /// </param>
        /// <param name="tableName">
        /// The table name.
        /// </param>
        /// <param name="uniqueKeyName">
        /// The unique key name.
        /// </param>
        /// <param name="dtObjects">
        /// The dt objects.
        /// </param>
        /// <param name="scrOption">
        /// The scr option.
        /// </param>
        /// <param name="sqlVersion">
        /// The sql version.
        /// </param>
        public CreateUniqueKey(string schema, string tableName, string uniqueKeyName, DatabaseDataSets dtObjects, SqlScriptingOption scrOption) : base(schema, tableName, uniqueKeyName, dtObjects, scrOption)
        {
        }

        /// <summary>
        /// The set rows.
        /// </summary>
        protected override void SetRows()
        {
            this.DataRowViews = this.DatabaseDiffData.GetUniqueKey(this.Schema, this.TableName, this.Name) ;	
        }
    }
}